CC=g++ -g
PROG3D=src/prog3d
MESH=src/mesh
MAIN=src/main
CFLAGS=-I$(PROG3D) -I$(MAIN) -I$(MESH)
LDFLAGS=-lSDL -lGLEW -lm -lIL
SRC= $(wildcard $(PROG3D)/*.cpp) $(wildcard $(MAIN)/*.cpp) $(wildcard $(MESH)/*.cpp)
OBJ= $(addprefix bin/,$(notdir $(SRC:.cpp=.o))) 
VPATH = $(MAIN):$(PROG3D):$(MESH)

run: $(OBJ)
	$(CC) -o $@ $^ $(LDFLAGS)

bin/%.o: %.cpp
	$(CC) -o $@ -c $< $(CFLAGS)

.phony clean:
	$(RM) bin/* run
